import {createApp} from 'vue'
import App from './App.vue'
// import {store, key} from './store';
import router from './router';
import 'vant/lib/index.css';
import Vant from 'vant'
import svgIcon from '@/plugins/svgicon'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'

router.beforeEach((_to, from, next) => {
  if (from.meta.allowBack) {
    // const showPopup = store.state.user.showPopup;
    if (showPopup) {
      // store.state.user.showPopup = false
      // @ts-ignore
      history.pushState(null, null, '#' + from.path)
    } else {
      next()
    }
  } else {
    next()
  }
})

const app = createApp(App);
svgIcon(app);
app.use(Vant)
    .use(router)
    .use(ElementPlus)
    .mount('#app');
